﻿





$.MGJ.FullContainerLoad = [];

(function () {
    var _this = $.MGJ.FullContainerLoad;
    $.extend($.MGJ.FullContainerLoad, {


    });
})(jQuery);
(function () {
    var _this = $.MGJ.FullContainerLoad;
    $.extend($.MGJ.FullContainerLoad, {
        Ajax_ListBox: function (pageIndex) {
            var key = $("#psearch").val();
            var reg = /^[A-Za-z0-9]{6,}$/;
            if (key == '' || key == null) {
                $.L.msgError('物流码不能为空！');
            } else if (!reg.test(key)) {
                $.L.msgError('物流码不能少于6位！');
            } else {
                $.L.ajaxHandle({
                    url: ACTION_URL("ListBox", "FleeGoods"),
                    data: {
                        key: key,
                        pageIndex: pageIndex,
                        pageSize: 10
                    },
                    success: function (response) {
                        if (response == 1) {
                            $.L.msgError("该物流码不属于当前企业")
                            return
                        } else if (response == 0) {
                            $.L.msgError("该物流码不存在！")
                            return
                        }


                        //$("#ListBoxInfo").L_bindingDataList(response);


                        //var html_body = "";

                        //var num = 0;
                        //function ShowBox(arr) {
                        //    num++
                        //    for (var i = 0; i < arr.length ; i++) {
                        //        html_body += "<td style='padding-left:" + (num * 30) + "px'>" + num + "级： " + arr[i].Wl_Code + "</td><td>" + arr[i].ParentCode + "</td></tr>";
                        //        if (arr[i]._Child instanceof Array) {
                        //            ShowBox(arr[i]._Child)
                        //        }
                        //        num--;
                        //    }
                        //}

                        //ShowBox(response)

                        ////var ParentCode = 0;
                        //$("table").append('<tbody id="ListBoxInfo">' + html_body + '</tbody>')


                        var Echart = echarts.init(document.getElementById('a'));
                        var option = {
                            toolbox: {
                                show: true,
                                feature: {
                                    mark: { show: true },
                                    dataView: { show: true, readOnly: false },
                                    restore: { show: true },
                                    saveAsImage: { show: true }
                                }
                            },
                            series: [
                                {
                                    name: '树图',
                                    type: 'tree',
                                    orient: 'horizontal',  // vertical horizontal
                                    rootLocation: { x: 100, y: 230 }, // 根节点位置  {x: 100, y: 'center'}
                                    nodePadding: 8,
                                    layerPadding: 200,
                                    hoverable: false,
                                    roam: true,
                                    symbolSize: 6,
                                    itemStyle: {
                                        normal: {
                                            color: '#4883b4',
                                            label: {
                                                show: true,
                                                position: 'right',
                                                formatter: "{b}",
                                                textStyle: {
                                                    color: '#000',
                                                    fontSize: 10
                                                }
                                            },
                                            lineStyle: {
                                                color: '#ccc',
                                                type: 'curve' // 'curve'|'broken'|'solid'|'dotted'|'dashed'

                                            }
                                        },
                                        emphasis: {
                                            color: '#4883b4',
                                            label: {
                                                show: false
                                            },
                                            borderWidth: 0
                                        }
                                    },

                                    data: response
                                }
                            ]
                        };
                        Echart.setOption(option);
                    },
                });
            }
        },

    });
})(jQuery);
(function () {
    var _this = $.MGJ.FullContainerLoad;
    $.extend($.MGJ.FullContainerLoad, {


    });
})(jQuery);



